package com.dementors.view;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.dementors.R;

import java.util.List;

/**
 * ***********************
 * author:raochen
 * time:2015/12/7.
 * name:特卖上新  4张图片组合的自定义控件
 * step:
 * ***********************
 */
public class FourImageView extends RelativeLayout {
    private Context context;
    private ImageView iv1, iv2, iv3, iv4;

    public FourImageView(Context context) {
        this(context, null);
    }

    public FourImageView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public FourImageView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
        LayoutInflater.from(context).inflate(R.layout.fourimageview, this,true);
        iv1 = (ImageView) findViewById(R.id.iv1_fourIV);
        iv2 = (ImageView) findViewById(R.id.iv2_fourIV);
        iv3 = (ImageView) findViewById(R.id.iv3_fourIV);
        iv4 = (ImageView) findViewById(R.id.iv4_fourIV);

    }

    public void setImageUrls(List<Bitmap> list) {
        Log.i("oye",list.size()+"");
        if (list.size() == 4) {

            iv1.setImageBitmap(list.get(0));
            iv2.setImageBitmap(list.get(1));
            iv3.setImageBitmap(list.get(2));
            iv4.setImageBitmap(list.get(3));
        }
    }


}
